package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsOrderMapper;
import com.qf.pojo.DtsOrder;
import com.qf.vo.CategorySellAmts;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService{
    @Autowired
    private DtsOrderMapper orderMapper;

    @Override
    public int countOrder() {
        QueryWrapper<DtsOrder> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("deleted",false);
        Integer count = orderMapper.selectCount(queryWrapper);


        return count;
    }

    @Override
    public List<DayStatis> incrCount() {
        List<DayStatis> list = orderMapper.staticsIncresOrderCut();

        return list;
    }

    @Override
    public List<CategorySellAmts> categoryCount() {
        List<CategorySellAmts> list = orderMapper.categorySell();

        return list;
    }
}
